<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="Creative - Bootstrap 3 Responsive Admin Template">
		<meta name="author" content="GeeksLabs">
		<meta name="keyword" content="Creative, Dashboard, Admin, Template, Theme, Bootstrap, Responsive, Retina, Minimal">

	</head>

	<body>
		<div class="col-lg-12" id="changePassword" >
							<ol class="breadcrumb">
								<li><i class="fa fa-home"></i>
									<a href="index.html">Home</a>
								</li>
								<li><i class=""></i>修改密码</li>
							</ol>
	
							<div class="mcomment">
								<h3 class="page-header"><i class=""></i>修改密码</h3>
								
								
									<div class="panel">
						<div class="panel-header">
							<h3>密码规则：</h3>
						</div>
						<ul class="content">
							<li>
								<p>密码必须包含大小写字母以及数字</p>
							</li>
							<li>
								<p>密码至少必须包含8个字符</p>
							</li>
							<li>
								<p>新密码不能用旧密码</p>
							</li>
						</ul>
					</div>
					<div class="panel">
						<div class="panel-header">
							<h3>新密码</h3>
						</div>
						
						<table class=" " >
							<tr>
							
								<td><label for="personalUsedPassword">原始密码：</label></td>
								<td><input v-model="personalUsedPassword"  
									 type="text" class="form-control" id="personalUsedPassword" placeholder="请输入原始密码" /></td>
																					
							</tr>
										<tr><td>&nbsp;</td></tr>
										
							<tr>
								
								<td><label for="personalNewPassword">新密码：</label></td>
								<td><input   v-model="personalNewPassword" 
									 type="text" class="form-control" id="personalNewPassword" placeholder="请输入新密码" /></td>
								
							</tr>
									   <tr><td>&nbsp;</td></tr>
							<tr>
								<td><label for="rePersonalNewPassword">确认密码：</label></td>
								<td><input  v-model="rePersonalNewPassword" type="text" class="form-control" id="rePersonalNewPassword" placeholder="请再次输入密码" /></td>
							</tr>
										 <tr><td>&nbsp;</td></tr>
						</table>
						
						<div class="content">
							
							<center>
								<div style="width: 50%;">
									<button  @click="save(userid)"  class="btn btn-primary">保存</button>
								</div>
							</center>
						</div>
					</div>
				

							</div>
						</div>
						
			<script  type="text/javascript">
				
			var cp = new Vue({
					var url1 = 'http://donting.utools.club';
					el:'#changePassword',
					data:{
						userid:'2',					//用户id
						personalUsedPassword:'',     //输入原始密码
						personalNewPassword:'',      //新密码
						rePersonalNewPassword:'',		//确认密码
					},
					methods:{
						
						save:function(){
							if((personalUsedPassword!=personalNewPassword)&&(personalNewPassword==rePersonalNewPassword)){
								
							  axios.defaults.withCredentials = true;
				         	  axios.get(url1+'/changepassword', {
								　　params: {  
												'userid': cp.userid,
											   'personalUsedPassword':cp.personalUsedPassword,
											}
								}).then(function (response) {
									var rs = response.data;
								　　
								if(response.code==200){		
									document.location = "index.html?data.username";
									alert("登陆成功"+rs.data.username);
								}else{
									alert("登陆失败"+rs.data.messg);
								}
								
								}).catch(function (error) {
								　　alert("连接超时！");
								});
											
							
								
							}
							
							alert("保存成功      "+"用户id:"+this.userid+"   新密码为  "+this.rePersonalNewPassword);
						}
						
						
					}
					
				})
				
				
			</script>			
		
	</body>

</html>